# This is a Python3 Script used to generate blockstate files of misaka cakes with candles
import json

colors = ["black","blue","brown","cyan","gray","green","light_blue","light_gray","lime","magenta","orange","pink","purple","red","white","yellow"]

# Model Template
def getColor(color):
    return {
      "variants": {
        "lit=false": {
          "model": "misaka:block/food/" + color + "_candle_cake"
        },
        "lit=true": {
          "model": "misaka:block/food/" + color + "_candle_cake_lit"
        }
      }
    }

# Unstained Candle
with open('candle_misaka_cake.json', 'w+') as f:
    data = json.dumps({
      "variants": {
        "lit=false": {
          "model": "misaka:block/food/candle_cake"
        },
        "lit=true": {
          "model": "misaka:block/food/candle_cake_lit"
        }
      }
    }, sort_keys=True, indent=4, separators=(',', ': '))
    f.write(data)

# Colored Candles...
for col in range(0, len(colors)):
    with open(colors[col] + '_candle_misaka_cake.json', 'w+') as f:
        data = json.dumps(getColor(colors[col]), sort_keys=True, indent=4, separators=(',', ': '))
        f.write(data)
